<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>04_JS流程控制</title>
</head>
<body>
<script>
  console.log('1');
  console.log('2');
  console.log('3');

  let uname = '';
  if (!uname) {
    alert('请输入用户名');
  }else {
    alert('登录成功');
  }

  let gender = 1;
  switch (gender) {
    case 1:
      alert('男');
      break;
    case 2:
      alert('女');
      break;
    default:
      alert('未知');
      break;
  }

  let names = ['张三','李四','王五'];
  for(var i = 0; i < names.length; i++) {
    console.log(names[i]);
  }
  console.log('循环结束')
  console.log(i);

  for (let name of names) {
    console.log(name);
  }
</script>
</body>
</html>
